package com.core.family.biz.yizhao.controller;

import com.core.common.annotation.MenuDesc;
import com.core.common.domain.response.R;
import com.core.common.gen.BaseQuery;
import com.core.common.gen.PageQuery;
import com.core.family.biz.yizhao.domain.po.YzKind;
import com.core.family.biz.yizhao.domain.po.YzSetting;
import com.core.family.biz.yizhao.domain.req.YzKindReq;
import com.core.family.biz.yizhao.domain.req.YzServiceReq;
import com.core.family.biz.yizhao.service.YzKindService;
import com.core.family.biz.yizhao.service.YzSettingService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;


/**
 * @author honglei
 * @version 1.0
 * @time: 2023-6-14 17:54:46
 * @Description 服务实现层 一招分类
 */
@MenuDesc(desc = "一招设置", code = "yzSetting")
@Api(tags = "YzSettingController 一招设置")
@RestController
@RequestMapping("/api/YzSetting/")
public class YzSettingController {

    @Autowired
    YzSettingService service;


    /**
     * 根据id获取详情
     *
     * @param request
     * @param
     * @return
     */
    @GetMapping(value = "get")
    public R get(HttpServletRequest request,String id) {
        return R.ok(service.getForYz(id));
    }



    /**
     * 批量查询
     *
     * @return
     */
    @RequestMapping(value = "getList", method = {RequestMethod.GET, RequestMethod.POST})
    public R getList(@RequestBody YzSetting bean) {
        return R.ok(service.getList(bean));
    }




    /**
     * 新增
     *
     * @param bean
     * @return
     */
    @PostMapping(value = "save")
    public R save(@RequestBody YzSetting bean) {
        return R.ok(service.create(bean));
    }

    /**
     * 删除
     *
     * @param request
     * @param id
     * @return
     */
    @PostMapping(value = "del/{id}")
    public R del(HttpServletRequest request, @PathVariable("id") String id) {
        return R.ok(service.delete(id));
    }




}
